<?php
session_start(); 
include_once('../classes/user.class.php');
$user = new User();
$check = $user->checkExist($_POST['username']);
if($check == 1) {
	echo 1;
	return false;
}
$user->register($_POST['username'], $_POST['password'], $_POST['firstname'], $_POST['lastname'], $_POST['email']); 
echo $user->login($_POST['username'], $_POST['password']);
?>